<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
</head>

<body>
    <script>
        var str =
            '{"status":200,"msg":"获取图书列表成功","data":[{"id":1,"bookname":"西游记","author":"吴承恩","publisher":"北京图书出版社"},{"id":2,"bookname":"红楼梦","author":"曹雪芹","publisher":"上海图书出版社"},{"id":3,"bookname":"三国演义","author":"罗贯中","publisher":"北京图书出版社"},{"id":5,"bookname":"抗击疫情自传","author":"菲斯在-周末人","publisher":"广西出版社"},{"id":6,"bookname":"一本书","author":"李四","publisher":"abc"},{"id":7,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":8,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":9,"bookname":"三国演义","author":"罗贯中","publisher":"北京图书出版社"},{"id":10,"bookname":"hello","author":"abc","publisher":"haha"},{"id":11,"bookname":"谁日了我的狗","author":"是你吗","publisher":"时你们吗?"},{"id":12,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":13,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":14,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":15,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":16,"bookname":"百年孤独","author":"尼古拉斯·赵四","publisher":"中华出版社"},{"id":17,"bookname":"百年孤独","author":"尼古拉斯·赵四","publisher":"中华出版社"},{"id":18,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":19,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":20,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":21,"bookname":"hello","author":"abc","publisher":"hahaha"},{"id":22,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":23,"bookname":"hello","author":"abc","publisher":"n11111"},{"id":24,"bookname":"百年孤独","author":"尼古拉斯·赵四","publisher":"中华出版社"},{"id":25,"bookname":"百年孤独","author":"尼古拉斯·赵四","publisher":"中华出版社"},{"id":26,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":27,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":28,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":29,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":30,"bookname":"hello","author":"abc","publisher":"nihao"},{"id":31,"bookname":"hello","author":"abc","publisher":"你好"},{"id":32,"bookname":"谁日了我的狗","author":"是你吗","publisher":"是你们吗?"}]}';

        var obj = JSON.parse(str);
        console.log(obj.data);

        var obj = {
            uname: "lisi",
            age: 12,
            gender: "male"
        };
        var userStr = JSON.stringify(obj);
        console.log(userStr);
        console.log(typeof userStr);
    </script>
</body>

</html>